text

abstract fun text(): String

Returns the content of the frame and its sub-frames as plain text or an empty string if the frame does not have content or its content is empty.

Limitations:

  • If the frame has sub-frames from another domain, their text will not be included into the return value.
  • No specification is given for how text from one frame will be delimited from the next.
  • The return value may contain text that is not visible to the user, whether due to scrolling, display:none, unexpanded divs, etc.
  • The ordering of the text does not reflect the ordering of the text on the page as seen by the user. Each element's text may appear in a totally different position in the result from its position on the page.

Please note that this functionality is resource-intensive, consuming significant memory and CPU during a text capture.

Throws

when the frame is closed